<template>
  <div class="detailPageCss">
    <div class="titleCss">配置上传周期</div>
    <div class="bodyCss">
      <div class="tableCss">
        <el-table
          max-height="650"
          :data="tableData"
          border
          style="width: 100%">
          <el-table-column
            type="index"
            label="序号"
            width="55"
            align="center">
          </el-table-column>
          <el-table-column
            prop="data1"
            label="资料类型"
            min-width="100">
            <template #default="scope">
              {{ data2Map[scope.row.data1] }}
            </template>
          </el-table-column>
          <el-table-column
            prop="data2"
            label="上传周期"
            min-width="150">
            <template #default="scope">
              <el-select v-model="tableData[scope.$index]['data2']" placeholder="选择上传周期" style="width:100%;">
                <el-option
                  v-for="item in tableData[scope.$index]['data2Options']"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <div class="bottomBtnCss">
      <el-button @click="goBackBtn">返回</el-button>
      <el-button type="primary" @click="submitBtn">保存</el-button>
    </div>
  </div>
</template>

<script>
import { getSelectOptionsFun } from '@/utils/business.js'
export default {
  data(){
    return{
      tableData:[],
      data2Map:{
        0:'卫生监督协管信息报告记录表',
        1:'卫生监督协管信息报送表',
        2:'卫生监督协管巡查工作记录表',
        3:'卫生监督协管教育宣传培训汇总表',
        4:'卫生监督协管健康教育活动记录表',
        5:'基本公共卫生服务职业卫生咨询宣传工作记录表',
        6:'公共场所卫生监督巡查记录表',
        7:'生活饮用水卫生监督巡查记录表',
        8:'医疗卫生监督巡查记录表',
        9:'放射卫生监督巡查记录表',
      },
    }
  },
  mounted(){
    this.getList()
  },
  methods:{
    handleCurrentChange(){
      
    },
    handleSizeChange(){
      
    },
    lookOldBtn(row){

    },
    lookNewBtn(row){

    },
    getList(){
      this.tableData = []
      for( let i=0;i<10 ; i++){
        this.tableData.push({
          data1: i,
          data2: null,
          data2Options: getSelectOptionsFun()
        })
      }
    },
    configBtn(){
      const obj = {
        path: '/dataIntegration/test4/lookFile/config',
        query: {
          id: '111',
        }
      }
      this.$router.push(obj);
    },
    submitBtn(){
      this.$router.back()
    },
    goBackBtn(){
      this.$router.back()
    },
  },
}
</script>

<style lang="scss" scoped>
.detailPageCss{
  overflow: hidden;
  position: relative;
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  height: calc( 100vh - 66px - 40px);
  display: flex;
  flex-direction: column;
  .titleCss{
    text-align: center;
    font-size: 18px;
    font-weight: bold;
  }
  .bodyCss{
    margin-top: 20px;
    width: 70%;
    margin-left: 50%;
    transform: translateX( calc( -50% ));
    .tableCss{
      margin-top: 20px;
    }
  }
  .bottomBtnCss{
    margin-top: auto;
    text-align: right;
  }
}
</style>